GATE CSE 2019


Q21.

Consider the following C program: #include int jumble(int x, int y) { x = 2 * x + y; return x; } int main() { int x = 2, y = 5; y = jumble(y, x); x = jumble(y, x); printf("%dn", x); return 0; } The value printed by program is __________ .
GateOverflow

Q22.

Consider the following C program: void convert(int n) { if (n<0) printf("%d",n); else { convert(n/2); printf("%d",n%2); } } Which one of the following will happen when the function convert is called with any positive integer n as argument?
GateOverflow

Q23.

Consider the following C program: #include < stdio.h > int r(){ int static num=7; return num--; } int main() { for(r();r();r()) { printf("%d ",r()); }; return 0; } Which one of the following values will be displayed on execution of the programs?
GateOverflow

Q24.

Consider the following statements: I. The smallest element in a max-heap is always at a leaf node. II. The second largest element in a max-heap is always a child of the root node. III. A max-heap can be constructed from a binary search tree in \Theta (n) time. IV. A binary search tree can be constructed from a max-heap in \Theta (n) time. Which of the above statements is/are TRUE?
GateOverflow

Q25.

Consider the following matrix: \begin{bmatrix} 1 & 2 & 4 & 8\\ 1& 3 & 9 &27 \\ 1 & 4 & 16 &64 \\ 1 & 5 & 25 &125 \end{bmatrix} The absolute value of the product of Eigenvalues of R is _________ .
GateOverflow

Q26.

The chip select logic for a certain DRAM chip in a memory system design is shown below. Assume that the memory system has 16 address lines denoted by A_{15} \; to \; A_0. What is the range of address (in hexadecimal) of the memory system that can get enabled by the chip select (CS) signal?
GateOverflow

Q27.

Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page size is 8kB and the word size is 4 bytes. The Translation Look-aside Buffer (TLB) in the address translation path has 128 valid entries. At most how many distinct virtual addresses can be translated without any TLB miss?
GateOverflow

Q28.

Let X be a square matrix. Consider the following two statements on X. I. X is invertible II. Determinant of X is non-zero Which one of the following is TRUE?
GateOverflow

Q29.

Let G be any connection, weighted, undirected graph: I. G has a unique minimum spanning tree if no two edges of G have the same weight. II. G has a unique minimum spanning tree if, for every cut of G, there is a unique minimum weight edge crossing the cut. Which of the above two statements is/are TRUE?
GateOverflow

Q30.

Let \Sigma be the set of all bijections from {1,...,5} to {1,...,5}, where id denotes the identity function, i.e. id(j)=j,\forall j. Let \circ denote composition on functions. For a string x = x_1x_2 ... x_n \in \Sigma ^n, n \geq 0, let \pi(x) = x_1\circ x_2\circ ... \circ x_n. Consider the language L = \{x \in \Sigma ^* | \pi(x) = id\}. The minimum number of states in any DFA accepting L is _________ .
GateOverflow